package de.wesemann.jdedun.entities.district.districts;

import de.wesemann.jdedun.entities.AbstractEntity;

/**
 * the districts in leipzig
 * 
 * @author spinner0815
 * 
 */
public class DistrictDistrict extends AbstractEntity {

    private int number;
    private String name;

    /**
     * von der Stadt Leipzig verwendete Nummerierung der Stadtteile
     * 
     * @return the number
     */
    public int getNumber() {
	return number;
    }

    /**
     * von der Stadt Leipzig verwendete Nummerierung der Stadtteile
     * 
     * @param number
     *            the number to set
     */
    public void setNumber(int number) {
	this.number = number;
    }

    /**
     * offizieller Name des Stadtteils
     * 
     * @return the name
     */
    public String getName() {
	return name;
    }

    /**
     * offizieller Name des Stadtteils
     * 
     * @param name
     *            the name to set
     */
    public void setName(String name) {
	this.name = name;
    }

    /*
     * (non-Javadoc)
     * 
     * @see java.lang.Object#hashCode()
     */
    @Override
    public int hashCode() {
	final int prime = 31;
	int result = super.hashCode();
	result = prime * result + ((name == null) ? 0 : name.hashCode());
	result = prime * result + number;
	return result;
    }

    /*
     * (non-Javadoc)
     * 
     * @see java.lang.Object#equals(java.lang.Object)
     */
    @Override
    public boolean equals(Object obj) {
	if (this == obj) {
	    return true;
	}
	if (!super.equals(obj)) {
	    return false;
	}
	if (getClass() != obj.getClass()) {
	    return false;
	}
	DistrictDistrict other = (DistrictDistrict) obj;
	if (name == null) {
	    if (other.name != null) {
		return false;
	    }
	} else if (!name.equals(other.name)) {
	    return false;
	}
	if (number != other.number) {
	    return false;
	}
	return true;
    }

    /*
     * (non-Javadoc)
     * 
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
	return "DistrictDistrict [number=" + number + ", name=" + name
		+ ", toString()=" + super.toString() + "]";
    }

}
